/*
* 类的初始化顺序
* 1、先初始化属性
* 2、调用构造函数
* 3、对象的方法调用
*
* */
class Book {
    String name;
    Leaf l1 = new Leaf(10);
    Book(String name) {
        this.name = name;
        System.out.println("一本书被创建");
    }
    Leaf l2 = new Leaf(29);

    Leaf l3;

    void show() {
        System.out.println(name);
    }
}

class Leaf {
    int page;

    Leaf(int page) {
        System.out.println("leaf("+page+")");
        this.page = page;
    }
}

public class TestSeq {
    public static void main(String[] args) {
        Book b1 = new Book("三体");
        b1.show();
    }
}
